<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function func1() {
            console.log("无参函数");
            for (let argument of arguments) {
                console.log(argument);
            }
            // 等价于以下代码
            /*for (let i = 0; i < arguments.length; i++) {
                console.log(arguments[i]);
            }*/
        }

        func1("312");
        func1(12, "abc");

        function sum() {
            var res = 0;
            for (let arg of arguments) {
                if (typeof arg == "number") {
                    res += arg;
                }
            }
            return res;
        }

        console.log(sum(12, 34,"abc", 23));
    </script>
</head>
<body>

</body>
</html>